package cultivameCore.motor.threads;

import cultivameCore.utils.ListaRefrescable;

public class InterfacesThread extends Thread {
	private int ms=30;
	private ListaRefrescable refresh;
	private boolean b=true;
	
	public InterfacesThread(ListaRefrescable _refrescableList){
		refresh=_refrescableList;
	}
	public void run(){
		while(b){
			for(int i=0;i<refresh.length();i++){
				refresh.get(i).actualizar(ms);
			}
			try {
				sleep(ms);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	};
	
	public ListaRefrescable getListaRefresh() {
		return refresh;
	}
	public void setListaRefresh(ListaRefrescable refresh) {
		this.refresh = refresh;
	}
	public void clear(){
		b=false;
	}
}
